from django.contrib import admin
from d115.siemes.models import *

class PageAdmin(AuditAdminMixin):
    list_display = ('created', 'modified', 'title', 'slug', 'language', 'status')
    list_display_links = ('created', 'title', 'slug',)
    search_fields = ('title','description', 'content', 'sidebar')
    list_filter = ('status', 'created', 'language')
    ordering = ['-modified',]
    class Media:
        js = ('/ckeditor/ckeditor.js', '/media/js/ckedit2.js')

class MenuItemAdmin(NomenclatureAdminMixin):
    list_display =('name', 'position', 'on_top', 'in_footer')
    list_display_links = ('name', )

class NewsItemAdmin(AuditAdminMixin):
    list_display = ('created', 'modified', 'language', 'content')
    list_display_links = ('created', )
    search_fields = ('content',)
    list_filter = ('created', 'language')

class SiteSettingAdmin(NomenclatureAdminMixin):
    list_display = ('site', 'name', 'value')
    list_editable = ()
    list_display_links = ('name',)
    list_filter = ('site', )

admin.site.register(StaticPage, PageAdmin)
admin.site.register(MenuItem, MenuItemAdmin)
admin.site.register(NewsItem, NewsItemAdmin)
admin.site.register(SiteSetting, SiteSettingAdmin)
